package com.shareit.ocr.controller;

import com.shareit.ocr.domain.Result;
import com.shareit.ocr.service.UIService;
import com.shareit.ocr.util.APIResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController
@RequestMapping("/face")
public class UIController {

	@Autowired
	private UIService uiService;
	@GetMapping(value ="/{facename}")
	public Result<?> getSource(@PathVariable(value = "facename", required = true) String facename) throws IOException {

		return APIResultUtil.sucess(uiService.getFacebyName(facename));
	}
}
